<cfif Not IsDefined("session.id")>
		<cflocation url = "/ecada/" addToken = "no">
</cfif>
	
<cfif IsDefined("session.experiment")>
	<cfset experiment = session.experiment>
<cfelse>
	<cflocation url="/ecada/"  addToken = "no">
</cfif>

<cfif IsDefined("form.Description") AND IsDefined("form.Title")>
	<cfquery datasource="exp">
		INSERT INTO conditions (description, expid, title)
		VALUES ( <cfqueryparam value="#form.Description#" cfsqltype="CF_SQL_VARCHAR">,
				 #experiment.id#,
				 <cfqueryparam value="#form.Title#" cfsqltype="CF_SQL_VARCHAR">
				 )
	</cfquery>
	<cflocation url="./../" addToken = "no">
<cfelse>
	<cfinclude template= "/ecada/header.cfm">
	<cfoutput>
		<form method="post" action="./">
			<table>
				<tr>
					<td>
						Title
					</td>
					<td>
						<input type="textbox" name="Title" id="Title">
					</td>
				</tr>
				<tr>
					<td>
						Description
					</td>
					<td>
						<input type="textbox" name="Description" id="Description">
					</td>
				</tr>
				<tr>
					<td>
						<button class="ui-state-default ui-corner-all" title="Next" type="submit" value="Next">
							<div style="display: inline-block; margin: 3px;line-height: 16px;"><b>Submit</b></div>
						</button>
					</td>
				</tr>
			</table>
</form>
			<table>
				<tr>
					<td>
						<form method="post" action="./../">
							<button class="ui-state-default ui-corner-all" title="Cancel" type="submit" value="Cancel">
								<div style="display: inline-block; margin: 3px;line-height: 16px;"><b>Cancel</b></div>
							</button>
						</form>
					</td>
				</tr>
			</table>
		
	</cfoutput>
	<cfinclude template= "/ecada/footer.cfm">
</cfif>



